package com.zoe.app.controller;

import com.zoe.app.entity.Author;
import com.zoe.app.entity.Book;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Zoe.Zhang
 * @date 2021/10/07
 * @description
 */
@Controller
public class BookController {
    @PostMapping("/book")
    @ResponseBody
    public String addBook(@ModelAttribute("book") Book book, @ModelAttribute("author") Author author) {
        System.out.println(book);
        System.out.println(author);
        return "1";
    }
}
